package wangyi;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws Exception{
        BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
        String s = buf.readLine();
        String[] ss = s.split(" ");
        int[] arr = new int[ss.length];
        for (int i = 0; i < ss.length; i++){
            arr[i] = Integer.parseInt(ss[i]);
        }
        s = buf.readLine();
        int target = Integer.parseInt(s);
        int res = 0;
        for (int i = 0; i < arr.length - 1; i++){
            for (int j = i + 1; j < arr.length; i++){
                if (arr[i] + arr[j] <= target){
                    res++;
                }
            }
        }
        System.out.println(res);
    }
}
